package utils

type Stock struct {
	CurrentScore int64 //当前库存值
	InitScore    int64 //初始库存值
}

var g_StockInstance *Stock

func (st *Stock) SetInitScore(score int64) {
	st.InitScore = score
}

func (st *Stock) SetCurrentScore(score int64) {
	st.CurrentScore = score
}

func (st *Stock) GetCurrentScore() int64 {
	return st.CurrentScore
}

func (st *Stock) GetInitScore() int64 {
	return st.InitScore
}

func (st *Stock) IncreaseScore(score int64) {
	st.CurrentScore += score
}

func (st *Stock) DecreaseScore(score int64) {
	st.CurrentScore -= score
}

func NewStock() *Stock {
	if g_StockInstance == nil {
		g_StockInstance = &Stock{}
	}

	return g_StockInstance
}
